home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
Xm
/
XmRedisplayWidget.z
/
XmRedisplayWidget
Wrap
Text File
|
1998-10-30
|
7KB
|
199 lines
XXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeetttt((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeetttt((((3333XXXX))))
NNNNAAAAMMMMEEEE
XXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeetttt - Synchronously activates the eeeexxxxppppoooosssseeee
method of a widget to draw its content
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
#include <Xm/Xm.h>
vvvvooooiiiiddddXXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeetttt(
WWWWiiiiddddggggeeeettttwwwwiiiiddddggggeeeetttt);
VVVVEEEERRRRSSSSIIIIOOOONNNN
This page documents Motif 2.1.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
This function is a convenience routine that hides the
details of the Xt internals to the application programmer by
calling the eeeexxxxppppoooosssseeeemethod of the given widget with a well
formed EEEExxxxppppoooosssseeeeevent and RRRReeeeggggiiiioooonnnncorresponding to the total area
of the widget. If the widget doesn't have an EEEExxxxppppoooosssseeeemethod,
the function does nothing.
This is primarily used in the context of X Printing if the
programming model chosen by the application is _s_y_n_c_h_r_o_n_o_u_s;
that is, it doesn't rely of X Print events for the driving
of page layout but wants to completely control the sequence
of rendering requests.
XXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeettttdoesn't clear the widget window prior to
calling the eeeexxxxppppoooosssseeeemethod, since this is handled by calls to
XXXXppppSSSSttttaaaarrrrttttPPPPaaaaggggeeee.
_w_i_d_g_e_t The widget to redisplay.
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
None.
EEEERRRRRRRROOOORRRRSSSS////WWWWAAAARRRRNNNNIIIINNNNGGGGSSSS
Not applicable
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
In the following, a simple application wants to print the
content of a multi-page text widget (similar to ddddttttppppaaaadddd).
PrintOKCallback(print_dialog...)
/*-------------*/
{
pshell = XmPrintSetup (print_dialog, pbs->print_screen,
"Print", NULL, 0);
XpStartJob(XtDisplay(pshell), XPSpool);
/**** here I realize the shell, get its size, create my widget
hierarchy: a bulletin board, and then a text widget,
Page 1 (printed 10/24/98)
XXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeetttt((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeetttt((((3333XXXX))))
that I stuff with the video text widget buffer */
/* get the total number of pages to print */
XtVaGetValues(ptext, XmNrows, &prows,
XmNtotalLines, n_lines, NULL);
n_pages = n_lines / prows;
/***** now print the pages in a loop */
for (cur_page=0; cur_page != n_pages; cur_page++) {
XpStartPage(XtDisplay(pshell), XtWindow(pshell), False);
XmRedisplayWidget(ptext); /* do the drawing */
XpEndPage(XtDisplay(pshell));
XmTextScroll(ptext, prows); /* get ready for next page */
}
/***** I'm done */
XpEndJob(XtDisplay(pshell));
}
Of course, one could change the above code to include it in
a ffffoooorrrrkkkk(((())))branch so that the main program is not blocked while
printing is going on. Another way to achieve a "print-in-
the-background" effect is to use an Xt workproc. Using the
same sample application, that gives us:
Boolean
PrintOnePageWP(XtPointer npages) /* workproc */
/*-------------*/
{
static int cur_page = 0;
cur_page++;
XpStartPage(XtDisplay(pshell), XtWindow(pshell), False);
XmRedisplayWidget(ptext); /* do the drawing */
XpEndPage(XtDisplay(pshell));
XmTextScroll(ptext, prows); /* get ready for next page */
if (cur_page == n_pages) { /***** I'm done */
XpEndJob(XtDisplay(pshell));
XtDestroyWidget(pshell);
XtCloseDisplay(XtDisplay(pshell));
}
return (cur_page == n_pages);
}
Page 2 (printed 10/24/98)
XXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeetttt((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmRRRReeeeddddiiiissssppppllllaaaayyyyWWWWiiiiddddggggeeeetttt((((3333XXXX))))
PrintOKCallback(...)
/*-------------*/
{
pshell = XmPrintSetup (widget, pbs->print_screen,
"Print", NULL, 0);
XpStartJob(XtDisplay(pshell), XPSpool);
/**** here I get the size of the shell, create my widget
hierarchy: a bulletin board, and then a text widget,
that I stuff with the video text widget buffer */
/* get the total number of pages to print */
/* ... same code as above example */
/***** print the pages in the background */
XtAppAddWorkProc(app_context, PrintOnePageWP, n_pages);
}
SSSSEEEEEEEE AAAALLLLSSSSOOOO
XXXXmmmmPPPPrrrriiiinnnnttttSSSSeeeettttuuuupppp(3), XXXXmmmmPPPPrrrriiiinnnnttttSSSShhhheeeellllllll(3)
Page 3 (printed 10/24/98)